(function() {
	const response = {
		type: 'page',
		title: '可盘点资产概览',
		data: {
			dateVar: "${TODAY()}"
		},
		toolbar: [
			{
				type: "button",
				label: "重新盘点",
				onEvent: {
					click: {
						actions: [
							{
								actionType: "refresh"
							}
						]
					}
				}
			}
		],
		body:[
				{
				type: "crud",
				syncLocation: false,
				"api": "post:/assetManager/getInventoryAsset",
				"headerToolbar": [
					{
						"type": "export-excel",
						label: "导出盘点结果",
						filename: "可盘点资产${dateVar}}",
						//自定义导出列
						columns:[
							"id",
							"assetName",
							"supplier",
							"life",
							"classes",
							"status",
							"result"

						]
					}
				],
				"footerToolbar": [
					{
						"type": "export-excel",
						level: "primary",
						label: "结束盘点并将结果导出至excel",
						filename: "可盘点资产${dateVar}}",
						//自定义导出列
						columns:[
							"id",
							"assetName",
							"supplier",
							"life",
							"classes",
							"status",
							"result"

						]
					},
					{
						type: "button",
						label: "重新盘点",
						onEvent: {
							click: {
								actions: [
									{
										actionType: "refresh"
									}
								]
							}
						}
					}
				],
				"autoFillHeight": true,
				columns:[
					{
						id: "assetRealId",
						name: "id",
						label: "资产编号",
					},
					{
						name: "assetId",
						hidden: "true"
					},
					{
						name: "assetName",
						label: "资产名"
					},
					{
						name: "supplier",
						label: "供应商"
					},
					{
						name: "life",

						label: "有效期至"
					},
					{
						name: "classes",
						label: "资产类别"
					},
					{
						name: "status",
						label: "资产状态"
					},
					{
						type: "button-group-select",
						label: "盘点结果",
						name: "result",
						value: "资产正常",
						options: [
							{
								"label": "资产正常",
								"value": "资产正常"
							},
							{
								"label": "资产异常",
								"value": "资产异常"
							},
							{
								"label": "无法盘点",
								"value": "无法盘点"
							}
						]
					}
				]

			}
		]
	}

	window.jsonpCallback && window.jsonpCallback(response);
})();
